<!DOCTYPE html>
<html>
  <head>
    <title>Sign Up</title>

    <link
      href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
      rel="stylesheet"
    />
  </head>
  <body>
    <div class="container">
      <h2 class="mt-5 mb-4 text-center">Sign Up</h2>
      <div class="row justify-content-center">
        <div class="col-md-6">
          {% if form.errors %}
          <div class="alert alert-danger" role="alert">
            <ul>
              {% for field in form %} {% for error in field.errors %}
              <li>{{ error }}</li>
              {% endfor %} {% endfor %} {% for error in form.non_field_errors %}
              <li>{{ error }}</li>
              {% endfor %}
            </ul>
          </div>
          {% endif %}
          <form method="post">
            {% csrf_token %}
            <div class="form-group">
              {{ form.username.label_tag }} {{ form.username }}
            </div>
            <div class="form-group">
              {{ form.email.label_tag }} {{ form.email }}
            </div>
            <div class="form-group">
              {{ form.password1.label_tag }} {{ form.password1 }}
            </div>
            <div class="form-group">
              {{ form.password2.label_tag }} {{ form.password2 }}
            </div>
            <button type="submit" class="btn btn-primary btn-block mt-3">
              Sign Up
            </button>
          </form>
        </div>
      </div>
    </div>

    <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.3/dist/umd/popper.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
  </body>
</html>
